package demo3学习hashcode方法;

public class Test {
    public static void main(String[] args) {
        Person p1 = new Person("zzr",20);
        Person p2 = new Person("zzr",20);

        //重写hasCode方法之前打印 两个值是不一样的
//        System.out.println(p1.hashCode());
//        System.out.println(p2.hashCode());

        //重写后就一样了
        System.out.println(p1.hashCode());
        System.out.println(p2.hashCode());
    }
}
